package cn.bdqn.controller;

import cn.bdqn.biz.IRoleBiz;
import cn.bdqn.pojo.Role;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
public class RoleController {
    @Autowired
    private IRoleBiz biz;
    @RequestMapping(value="/getRoleList",produces = "text/json;charset=UTF-8")
public  String getRoleList(HttpSession session){
 List<Role> roleList= (List<Role>) session.getAttribute("rolelist");
   if (roleList==null) {
       roleList = biz.roleList();
   }
        session.setAttribute( "rolelist",roleList);
    return  "jsp/userlist";
}

}
